import {useForm} from "react-hook-form";
/*
*  react-hooks-form 基本使用
* */
export const Home = () => {
	const {register, handleSubmit} = useForm();

	const onSubmit = (data) => {
		console.log(data);
	}

	return (
		<form onSubmit={handleSubmit(onSubmit)}>
			姓名: <input type="text" {...register('name')} /> <br/>
			年龄: <input type="text" {...register('age')} /> <br/>
			<button type="submit">提交</button>
		</form>
	)
}